const validator = (req, res, next) => {
    if(
        req.method === 'POST'
        && req.headers["user-agent"].includes('https://vk.com')
        && req.body.secret !== process.env.SECRET_KEY
    ) return res.status(401).send('Invalid secret key');

    next();
};

module.exports = validator;
